package com.szq.pattern;

/**
 * @description: 懒汉模式（线程安全）
 * @author: szq
 * @date: 2021-08-26 10:23:25
 */
public class Singleton_02 {

    private static Singleton_02 instance;

    private Singleton_02(){}

    public static synchronized Singleton_02 getInstance(){
        if (null != instance){
            return instance;
        }
        instance = new Singleton_02();
        return instance;
    }
}
